<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>其他行为监管信息管理</title>
	<script src="../../../js/header.js"></script>
</head>

<body>
<div v-cloak id="app" style="overflow: hidden;">
	<el-row type="flex" justify="center">
		<el-col :span="15">
			<el-breadcrumb separator-class="el-icon-arrow-right" style="margin-top: 20px;">
				<el-breadcrumb-item :to="{ path: '/' }"  @click.native="gobackmain()">首页</el-breadcrumb-item>
				<el-breadcrumb-item>其他行为监管</el-breadcrumb-item>
			</el-breadcrumb>
			<div style="margin-top: 10px;border-bottom:1px solid rgba(200,200,200,0.43);">
				<el-form :model="selectForm" :rules="rules" ref="selectForm" label-width="150px">
					<el-row>
						<el-col :span="8">
							<el-form-item label="监管事项目录编码:" prop="" label-width="160px">
								<el-input v-model="selectForm.superviseItemCode" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
						<el-col span="8">
							<el-form-item label="记录唯一标识:">
								<el-input v-model="selectForm.recordUniqueIdentity" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="8">
							<el-form-item label="行为名称:" prop="" label-width="160px">
								<el-input v-model="selectForm.actionName" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item label="行为编号:" prop="">
								<el-input v-model="selectForm.actionCode" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="8">
							<el-form-item label="检查行为编号:" prop="" label-width="160px">
								<el-input v-model="selectForm.checkBehaviorNumber" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item label="监管对象:" prop="" label-width="160px">
								<el-input v-model="selectForm.superviseObject" placeholder="" ></el-input>
							</el-form-item>
						</el-col>
						<el-col>
							<div style="float: right;">
								<el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="searchForm()">查询</el-button>
								<el-button type="warning" size="small" style="width: 60px;height: 30px;" @click="resetForm()">重置</el-button>
							</div>
						</el-col>
					</el-row>
				</el-form>
			</div>

			<el-table :data="tableData" border style="width: 100%;margin-top: 35px;" @selection-change="handleSelectionChange" :header-cell-style="{background:'#eef1f6',color:'#606266'}">
				<el-table-column type="selection" ></el-table-column>
				<el-table-column
						prop="superviseItemCode"
						label="监管事项目录编码"
						width="150"
						align="center" >
				</el-table-column>
				<el-table-column
						prop="recordUniqueIdentity"
						label="记录唯一标识"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						prop="actionName"
						label="行为名称"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						prop="actionCode"
						label="行为编号"
						width="150"
						align="center">
				</el-table-column>
				<el-table-column
						prop="checkBehaviorNumber"
						label="检查行为编号"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						prop="superviseObject"
						label="监管对象"
						width="200"
						align="center">
				</el-table-column>
				<el-table-column
						label="操作"
						width=""
						align="center">
					<template slot-scope="scope">
						<el-button size="mini" @click="view(scope.$index,scope.row)">查看</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="overflow: hidden;">
				<div class="pagination">
					<el-pagination
							@size-change="handleSizeChange"
							@current-change="handleCurrentChange"
							:current-page="currentPage"
							:page-sizes="[10]"
							:page-size="pagesize"
							background
							layout="total, sizes,prev, pager, next"
							:total="tableTotal"
							prev-text="上一页"
							next-text="下一页">
					</el-pagination>
				</div>
			</div>
			<el-button type="primary" size="mini" @click="appovalExByIds()" style="margin-left: 20px;float: right;">导出</el-button>
			<el-button type="primary" size="mini" @click="appovalEx()" style="float: right;">批量导出</el-button>

			<!-- 其他行为监管信息详细页 -->
			<el-dialog title="" :visible.sync="dialogForm" center fullscreen>
				<el-row type="flex" justify="center" style="margin-top: 15px;">
					<el-col :span="15">
						<div style="margin-top: 10px;">
					<el-form :model="jgxwother" :rules="rules" ref="jgxwother" label-width="140px" class="form_date_width">
						<!--其他行为监管信息表-->
						<el-row>
							<el-col :span="4" class="tab-title">
								其他行为监管信息表
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="监管事项目录编码:" prop="superviseItemCode" label-width="200px">
									<el-input v-model="jgxwother.superviseItemCode" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="记录唯一标识:" prop="recordUniqueIdentity" label-width="200px">
									<el-input v-model="jgxwother.recordUniqueIdentity" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="行为名称:" prop="actionName" label-width="200px">
									<el-input v-model="jgxwother.actionName" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col span="12">
								<el-form-item label="行为编号:" prop="actionCode" label-width="200px">
									<el-input v-model="jgxwother.actionCode" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col span="12">
								<el-form-item label="检查行为编号:" prop="checkBehaviorNumber" label-width="200px">
									<el-input v-model="jgxwother.checkBehaviorNumber" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="行政区划代码:" prop="areaNumber" label-width="200px">
									<el-input v-model="jgxwother.areaNumber" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="监管对象:" prop="superviseObject" label-width="200px">
									<el-tooltip class="item" effect="dark" content="1、企业、个体户、农专社，填写为企业统一社会信用代码；
																					2、自然人时，填写身份证号；
																					3、特种设备时，填写生产企业统一社会信用代码#产品品牌#出厂日期
																					4、为特定产品（食品）时，填写生产企业统一社会信用代码#生产批号
																					5、为特定产品（三种特殊食品）时，填写生产企业统一社会信用代码#生产批号
																					6、特定产品为药品时，填写生产企业统一社会信用代码#生产许可证编号#生产批号
																					7、特定产品为化妆品时，填写生产企业统一社会信用代码#生产许可证编号#生产批号
																					8、特定产品为医疗器械时，填写生产企业统一社会信用代码#注册证编号#生产批号
																					9、为场地场所时，填写场地场所名称#所在地区" placement="top-start">
										<el-input v-model="jgxwother.superviseObject" placeholder="" :disabled="formDisabled"></el-input>
									</el-tooltip>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="事项来源:" prop="itemSource" label-width="200px">
									<el-input v-model="jgxwother.itemSource" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="实施机构:" prop="implementInstitutio" label-width="200px">
									<el-input v-model="jgxwother.implementInstitutio" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="实施机构编码:" prop="implementInstitutioCode" label-width="200px">
									<el-input v-model="jgxwother.implementInstitutioCode" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="受委托部门:" prop="entrustDept" label-width="200px">
									<el-input v-model="jgxwother.entrustDept" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="受委托部门编码:" prop="entrustDeptCode" label-width="200px">
									<el-input v-model="jgxwother.entrustDeptCode" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="行政相对人（单位/个人）:" prop="administrativeCp" label-width="200px">
									<el-input v-model="jgxwother.administrativeCp" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="行政相对人性质:" prop="administrativeCpNa" label-width="200px">
									<el-select v-model="jgxwother.administrativeCpNa" placeholder="请选择行政相对人性质" :disabled="formDisabled" style="width: 100%;">
										<el-option
												v-for="item in cpNaData"
												:key="item.appId"
												:label="item.dictName"
												:value="item.dictName">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="行政相对人证件类型:" prop="administrativeCpCeType" label-width="200px">
									<el-select v-model="jgxwother.administrativeCpCeType" placeholder="请选择行政相对人证件类型" :disabled="formDisabled" style="width: 100%;">
										<el-option
												v-for="item in cpCeTypeData"
												:key="item.appId"
												:label="item.dictName"
												:value="item.dictName">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="行政相对人(单位/个人)编码:" prop="administrativeCpUiCode" label-width="200px">
									<el-input v-model="jgxwother.administrativeCpUiCode" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="注册地址:"  prop="addressRegistered" label-width="200px">
									<el-input v-model="jgxwother.addressRegistered" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="经营地址:"  prop="addressOperating" label-width="200px">
									<el-input v-model="jgxwother.addressOperating" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>

							<el-col :span="12">
								<el-form-item label="监管措施:" prop="superviseMeasure" label-width="200px">
									<el-input v-model="jgxwother.superviseMeasure" placeholder="" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="结案情况:" prop="closingCase" label-width="200px">
									<el-input v-model="jgxwother.closingCase" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="开始时间:" prop="startDate" label-width="200px">
									<el-date-picker
											v-model="jgxwother.startDate"
											type="date"
											value-format="yyyy-MM-dd"
											placeholder="选择开始时间"
											:disabled="formDisabled">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="结束时间:" prop="endDate" label-width="200px">
									<el-date-picker
										v-model="jgxwother.endDate"
										type="date"
										value-format="yyyy-MM-dd"
										placeholder="选择结束时间"
										:disabled="formDisabled">
									</el-date-picker>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="报送时间:" prop="submittedDate" label-width="200px">
									<el-date-picker
											v-model="jgxwother.submittedDate"
											type="date"
											value-format="yyyy-MM-dd"
											placeholder="选择报送时间"
											:disabled="formDisabled">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="报送人员:" prop="submittedPersonnel" label-width="200px">
									<el-input v-model="jgxwother.submittedPersonnel" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="插入时间:" prop="inputTime" label-width="200px">
									<el-date-picker
											v-model="jgxwother.inputTime"
											type="date"
											value-format="yyyy-MM-dd"
											placeholder="选择插入时间"
											:disabled="formDisabled">
									</el-date-picker>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="来源:" prop="actionSource" label-width="200px">
									<el-input v-model="jgxwother.actionSource" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="批次号:" prop="batchNumberCode" label-width="200px">
									<el-input v-model="jgxwother.batchNumberCode" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12">
								<el-form-item label="同步类型:" prop="synchroType" label-width="200px">
									<el-input v-model="jgxwother.synchroType" :disabled="formDisabled"></el-input>
								</el-form-item>
							</el-col>

						</el-row>
						<el-row>
							<el-col :span="12">
								<el-form-item label="数据来源:" prop="recordSource" label-width="200px">
									<el-tooltip class="item" effect="dark" content="数据来源由三位数字组成。其中，第1位填写：0或者1，0代表应急管理部部本级，1代表地方。当第1位填写0时，第2、3位填写“部本级业务系统”代码集中对应的代码；当第1位填写1时，第2、3位填写“行政区划代码”代码集中对应的代码。" placement="top-start">
										<el-input v-model="jgxwother.recordSource" :disabled="formDisabled"></el-input>
									</el-tooltip>
								</el-form-item>
							</el-col>
						</el-row>

						<el-row>
							<el-col :span="22">
								<div style="float:right;">
									<el-button type="info" size="small" style="width: 60px;height: 30px;" @click="dialogForm = false;">取消</el-button>
								</div>
							</el-col>
						</el-row>
					</el-form>
				</div>
					</el-col>
				</el-row>
			</el-dialog>
		</el-col>
	</el-row>
</div>
<script>
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                // 行政相对人性质
                cpNaData : [],
                // 行政相对人证件类型数组
                cpCeTypeData : [],


                currentPage: 1, //默认显示页面为1
                pagesize: 10, // 每页的数据条数
                tableTotal:'',

				jgxwother: {
                    actionId: '',// 表单id
                    superviseItemCode: '',
                    recordUniqueIdentity: '',
                    actionName: '',
                    actionCode: '',
                    checkBehaviorNumber: '',
                    superviseObject: '',
                    itemSource: '',
                    implementInstitutio: '',
                    implementInstitutioCode: '',
                    entrustDept: '',
                    entrustDeptCode: '',
                    administrativeCp: '',
                    administrativeCpNa: '',
                    administrativeCpCeType: '',
                    administrativeCpUiCode: '',
                    addressRegistered: '',
                    addressOperating: '',
                    areaNumber: '',
                    superviseMeasure: '',
                    closingCase: '',
                    startDate: '',
                    endDate: '',
                    submittedDate: '',
                    submittedPersonnel: '',
                    inputTime: '',
                    actionSource: '',
                    batchNumberCode: '',
                    synchroType: '',
                    recordSource: '',

                },
                formDisabled: false,
                dialogForm: false,
                selectForm: {
                    superviseItemCode: '',
                    recordUniqueIdentity: '',
                    actionName: '',
                    actionCode: '',
                    checkBehaviorNumber: '',
                    superviseObject: ''
                },
                Form: {
                    superviseItemCode: '',
                    recordUniqueIdentity: '',
                    actionName: '',
                    actionCode: '',
                    checkBehaviorNumber: '',
                    superviseObject: ''
                },
                tableData: [],
                exportList:[]
            }
        },
        created() {
            /* 地区加载数据 */
          /*  axios.get('../../json/ChinaCity.json').then(res => {
                this.provinceData = res.data;
			}).catch(e => {
					this.$message.error("网络连接超时");
			})*/

   			/* 行政相对人证件类型加载数据 */
            axios.post('/dzjportal/dict/getdict/d_administrativeCpCeType').then(res => {
                this.cpCeTypeData = res.data.data.result;
            }).catch(e => {
                this.$message.error("网络连接超时");
            })


            /* 行政相对人性质加载数据 */
            axios.post('/dzjportal' + '/dict/getdict/d_administrativeCpNa').then(res => {
                this.cpNaData = res.data.data.result;
            }).catch(e => {
                this.$message.error("网络连接超时");
            })



        },
        mounted(){
            this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;

                axios({
                    method: 'get',
                    url: '/dzjportal/other/getPage',
                    params: {
                        superviseItemCode: this.Form.superviseItemCode.trim(),
                        recordUniqueIdentity: this.Form.recordUniqueIdentity.trim(),
                        actionName: this.Form.actionName.trim(),
                        actionCode: this.Form.actionCode.trim(),
                        checkBehaviorNumber: this.Form.checkBehaviorNumber.trim(),
                        superviseObject: this.Form.superviseObject.trim(),
                        pageSize: pagesize,
                        pageNo: pageno
                    }
                })
				.then(response => {
					let data = response.data;
					if (data.code == 200) {
						let dataInformation = data.data.results;
						this.tableTotal = data.data.total;// 数据长度

						this.tableData = dataInformation;
					} else {
						this.$message.error(data.msg);
					}
				})
				.catch(function (error) {
					console.log(error);
				});
            },
            clearForm(){
                this.$refs.jgxwother.clearValidate();
                this.jgxwother.actionId = '';
                this.jgxwother.superviseItemCode = '';
                this.jgxwother.recordUniqueIdentity = '';
                this.jgxwother.actionName = '';
                this.jgxwother.actionCode = '';
                this.jgxwother.checkBehaviorNumber = '';
                this.jgxwother.superviseObject = '';
                this.jgxwother.itemSource = '';
                this.jgxwother.implementInstitutio = '';
				this.jgxwother.implementInstitutioCode = '';
				this.jgxwother.entrustDept = '';
				this.jgxwother.entrustDeptCode = '';
				this.jgxwother.administrativeCp = '';
				this.jgxwother.administrativeCpNa = '';
				this.jgxwother.administrativeCpCeType = '';
				this.jgxwother.administrativeCpUiCode = '';
				this.jgxwother.addressRegistered = '';
				this.jgxwother.addressOperating = '';
				this.jgxwother.areaNumber = '';
				this.jgxwother.superviseMeasure = '';
                this.jgxwother.closingCase = '';
                this.jgxwother.startDate = '';
                this.jgxwother.endDate = '';
                this.jgxwother.submittedDate = '';
                this.jgxwother.submittedPersonnel = '';
                this.jgxwother.inputTime = '';
                this.jgxwother.actionSource = '';
                this.jgxwother.batchNumberCode = '';
                this.jgxwother.synchroType = '';
                this.jgxwother.recordSource = '';

            },
            handleChange(value) {
                console.log(value);
            },
            /* 列表页搜索 */
            searchForm() {
                var pagesize = this.pagesize;
                this.currentPage = 1;
                var pageno = this.currentPage;
                this.Form=  JSON.parse(JSON.stringify(this.selectForm));
                axios({
                    method: 'get',
                    url: '/dzjportal/other/getPage',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        superviseItemCode: this.Form.superviseItemCode.trim(),
                        recordUniqueIdentity: this.Form.recordUniqueIdentity.trim(),
                        actionName: this.Form.actionName.trim(),
                        actionCode: this.Form.actionCode.trim(),
                        checkBehaviorNumber: this.Form.checkBehaviorNumber.trim(),
                        superviseObject: this.Form.superviseObject.trim(),

                    }
                })
                .then(response => {
                    let data = response.data;
                    console.log(data);
                    if (data.code == 200) {
                        let dataInformation = data.data.results;
                        this.tableTotal = data.data.total;// 数据长度

                        this.tableData = dataInformation;
                    } else {
                        this.$message.error(data.msg);
                    }
                })
                .catch(function (error) {
                    console.log(error);
                });
            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.superviseItemCode = '';
				this.selectForm.recordUniqueIdentity = '';
                this.selectForm.actionName = '';
                this.selectForm.actionCode = '';
                this.selectForm.checkBehaviorNumber = '';
				this.selectForm.superviseObject = '';
                this.Form.superviseItemCode = '';
                this.Form.recordUniqueIdentity = '';
                this.Form.actionName = '';
                this.Form.actionCode = '';
                this.Form.checkBehaviorNumber = '';
                this.Form.superviseObject = '';
                this.currentPage = 1;
                this.getData();
            },
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
                /*console.log(this.pagesize) */
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            // 设置允许填写和不允许填写
            checkDisabled(n){
                if(n){
                    this.formDisabled = true;
                }else{
                    this.formDisabled = false;
                }
            },
            // 查看
            view(index,row){
                this.dialogForm = true;
                this.jgxwother = row;
                this.checkDisabled(true);
            },
			/*返回首页*/
            gobackmain(){
                parent.mainwork.backIndex();
            },
            //批量导出
            appovalEx(){
                this.$confirm('确定要批量导出吗?', '提示', {
                    cancelButtonText: '取消',
                    confirmButtonText: '确定',
                    type: 'warning'
                }).then(() => {
                    window.location.href="/dzjportal/other/export?superviseItemCode="+this.selectForm.superviseItemCode+"&recordUniqueIdentity="
                        +this.selectForm.recordUniqueIdentity+"&actionName="+this.selectForm.actionName+"&actionCode="+this.selectForm.actionCode+
						"&checkBehaviorNumber="+this.selectForm.checkBehaviorNumber+"&superviseObject="+this.selectForm.superviseObject;
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消导出'
                    });
                });
            },
            handleSelectionChange(val) {
                this.exportList = val;
            },
            //导出
            appovalExByIds(){
                if(this.exportList.length >0){
                    this.ids = this.exportList.map(function(exportList,index){
                        return exportList.actionId;
                    }).join(",");
                    this.$confirm('确定要导出所选数据吗?', '提示', {
                        cancelButtonText: '取消',
                        confirmButtonText: '确定',
                        type: 'warning'
                    }).then(() => {
                        window.location.href="/dzjportal/other/exportByIds?ids="+this.ids
                    }).catch(() => {
                        this.$message({
                            type: 'info',
                            message: '取消导出'
                        });
                    });
                }else {
                    this.$message('请选择要导出的数据！');
                }
            }
        }
    })
</script>
</body>
</html>